package com.smarthome.domain.enums;

public enum ShUserResourceOpenFlagEnum {

    CLOSE(0, "关闭"), 
    OPEN(1, "开启");

    private int flag;
    private String comment;

    private ShUserResourceOpenFlagEnum(int flag, String comment) {
        this.flag = flag;
        this.comment = comment;
    }

    public int getFlag() {
        return flag;
    }

    public String getComment() {
        return comment;
    }

    public static ShUserResourceOpenFlagEnum getByFlag(int flag) {
        for (ShUserResourceOpenFlagEnum subEnum : values()) {
            if (subEnum.getFlag() == flag) {
                return subEnum;
            }
        }
        throw new IllegalArgumentException("none-defined ShPropertyResourceOpenFlagEnum,flag:" + flag);
    }

}
